<template>
  <a-drawer
    width="80%"
    closable
    placement="right"
    :visible="visible"
    @close="visible=false"
  >
    <div slot="title" class="g-flex g-y-center">
      <div style="color: #000000;font-weight: bold;">项目详情</div>
      <div style="font-size: 12px;margin-left: 30px;color: #333333;">姓名：{{row_record.name}}</div>
      <div style="font-size: 12px;margin-left: 20px;color: #333333;">卡号：{{row_record.card_no}}</div>
    </div>
    <a-spin :spinning="spinning">
      <a-table
        :scroll="{x:1000}"
        :columns="innerColumns"
        :data-source="itemList"
        :rowKey="(record,index)=> index"
      >
        <!--序号-->
        <template slot="index" slot-scope="text,record,index">
          <span>{{index+1}}</span>
        </template>
      </a-table>
    </a-spin>

  </a-drawer>
</template>

<script>
import {getConsultItemDetails} from '@/api/modular/main/customer/customerScene'
export default {
  props:{
    row_record:{
      type:Object,
      default:()=>{{}}
    }
  },
  data () {
    return {
      spinning:true,
      visible:false,
      form: this.$form.createForm(this),
      itemList:[],
      innerColumns: [
        { title: '序号', scopedSlots: { customRender: 'index' },width:60,fixed:'left' },
        { title: '状态', dataIndex: 'chargeState',width: 80, ellipsis: true ,fixed:'left'},
        { title: '业绩科室', dataIndex: 'execDept', width: 100, ellipsis: true},
        { title: '商品名称', dataIndex: 'itemName', width: 100,ellipsis: true },
        { title: '单位', dataIndex: 'unit',width: 80, ellipsis: true },
        { title: '增值金抵扣', dataIndex: 'itemGold', width: 100, ellipsis: true },
        { title: '积分抵扣', dataIndex: 'itemJf', width: 100,ellipsis: true },
        { title: '消费券抵扣', dataIndex: 'itemTicket', width: 120, ellipsis: true },
        { title: '类型', dataIndex: 'item_type_name', width: 70, ellipsis: true },
        { title: '类型名称', dataIndex: 'itemType', width: 100, ellipsis: true },
        { title: '折扣说明', dataIndex: 'discountRemark', width: 100, ellipsis: true },
        { title: '项目备注', dataIndex: 'remark',width: 100, ellipsis: true },
        { title: '数量', dataIndex: 'qty', width: 80, ellipsis: true ,fixed:'right'},
        { title: '单价', dataIndex: 'itemPrice', width: 110, ellipsis: true,fixed:'right' },
        { title: '总价', dataIndex: 'chargeAmt', width:110, ellipsis: true,fixed:'right' },
        { title: '折扣', dataIndex: 'discount', width: 110,ellipsis: true ,fixed:'right'},
        { title: '应付金额', dataIndex: 'payableAmt', width: 100,ellipsis: true ,fixed:'right'},
      ],
    }
  },
  methods: {
    show () {
      this.visible = true
      this.$nextTick(()=>{
        const schemeId = this.row_record.tbConsultSchemeId
        console.log('行数据',this.row_record)
        this.spinning=true
        getConsultItemDetails({schemeId}).then(res=>{

          console.log('咨询详情',res)
          this.itemList=res.data
          this.spinning=false
        })
      })

    },
  }
}
</script>

<style lang="less" scoped>

</style>

